<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>角色管理</title>
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<link href="http://static.mttang.com/css/Public.css" rel="stylesheet"
	type="text/css" />
<link href="http://static.mttang.com/css/recharge.css" rel="stylesheet"
	type="text/css" />
<link type="text/css" rel="stylesheet"
	href="http://static.mttang.com/css/validator.css"></link>
<script type="text/javascript"
	src="http://static.mttang.com/js/jquery-1.4.2.min.js"></script>
<script src="http://static.mttang.com/js/formValidator.js"
	type="text/javascript" charset="UTF-8"></script>
<script src="http://static.mttang.com/js/formValidatorRegex.js"
	type="text/javascript" charset="UTF-8"></script>
<script src="../javascripts/sysValidate.js"></script>
<script>
		   $(document).ready(function(){
				$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){return true;}});
				$('#roleName').formValidator({onshow:"请输入角色名称",oncorrect:"输入正确",empty:false,onfocus:"角色名称不能为空",tipid:"roleNameTip"})
				.inputValidator({type:"size",min:"1",max:"20",onerror:"角色名称长度不正确"});
			});		

		</script>
</head>
<body>
<div id="man_zone">
<center><c:out value="${bean.message}" /></center>
<form action="role.do?method=add" id="form1" method="post"   >
<table class="table_style" border="0" align="center" cellpadding="3"
	cellspacing="1">
	<tr>
		<div align="left" ><td align="left" class="left_title_1">角色名称:
		<input type="text" id="roleName" name="roleName"
			onblur="roleUnique();" value="<c:out value='${bean.roleName}'/>" /> <input
			type="hidden" id="roleName1" value="" /></td>
			</div>
		<td>
		<div id="roleNameTip"></div>
		</td>
	</tr>
	<tr>
		<div align="left" ><td align="left" class="left_title_1">权限:</td></div>
		<td></td>
	</tr>
	<tr align="left">
		<td>
		<table>
			<c:if test="${bean.mlist != null}">
				<c:forEach items="${bean.mlist}" var="menu" varStatus="status">
					<c:if test="${menu.menuLevel==1}">
						<tr>
							<td align="left"><c:out value='${menu.menuName}' />
							</td><td> <c:forEach
								items="${bean.linklist.list}" var="linklist" varStatus="status">
								<c:if test="${linklist.menuId==menu.menuId}">
									<c:forEach items="${linklist.list}" var="link"
										varStatus="status">
										<input name="linkId" type="checkbox" onclick="checktree();"
											id="linkId" value="<c:out value='${link.linkId}'/>" />
										<c:out value='${link.name}' />
									</c:forEach>
								</c:if>
							</c:forEach></td>
						</tr>
					</c:if>
					<c:if test="${menu.menuLevel==2}">
						<tr>
							<td align="left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<c:out
								value='${menu.menuName}' />
							</td><td> <c:forEach
								items="${bean.linklist.list}" var="linklist" varStatus="status">
								<c:if test="${linklist.menuId==menu.menuId}">
									<c:forEach items="${linklist.list}" var="link"
										varStatus="status">
										<input name="linkId" type="checkbox" onclick="checktree();"
											id="linkId" value="<c:out value='${link.linkId}'/>" />
										<c:out value='${link.name}' />
									</c:forEach>
								</c:if>
							</c:forEach></td>
						</tr>
					</c:if>
					<c:if test="${menu.menuLevel==3}">
						<tr>
							<td align="left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<c:out
								value='${menu.menuName}' />
							</td><td> <c:forEach
								items="${bean.linklist.list}" var="linklist" varStatus="status">
								<c:if test="${linklist.menuId==menu.menuId}">
									<c:forEach items="${linklist.list}" var="link"
										varStatus="status">
										<input name="linkId" type="checkbox" onclick="checktree();"
											id="linkId" value="<c:out value='${link.linkId}'/>" />
										<c:out value='${link.name}' />
									</c:forEach>
								</c:if>
							</c:forEach></td>
						</tr>
					</c:if>
				</c:forEach>
			</c:if>
		</table>
		</td>
		<td></td>
	</tr>
	<tr>
		<td>
		<input type="hidden"  id="prv" name="prv" value="insert" />
		<input type="submit" onclick=" return roleUnique();" value="提交"/></td>
			<td></td>
	</tr>
</table>
</form>
</div>
</body>
</html>